import type { FlashProductRelation, FlashProductRelationPageDto } from '@/models/flashProductRelation'
import type { CommonResult, CommonPage } from '@/models/request'
import request from '@/utils/request'
export function fetchList(params: FlashProductRelationPageDto) {
  return request<CommonPage<FlashProductRelation>>({
    url: '/flashProductRelation/list',
    method: 'get',
    params: params,
  })
}
export function createFlashProductRelation(data: FlashProductRelation[]) {
  return request<CommonResult>({
    url: '/flashProductRelation/create',
    method: 'post',
    data: data,
  })
}
export function deleteFlashProductRelation(id: number) {
  return request<CommonResult>({
    url: '/flashProductRelation/delete/' + id,
    method: 'post',
  })
}
export function updateFlashProductRelation(data: FlashProductRelation) {
  return request<CommonResult>({
    url: '/flashProductRelation/update/' + data.id,
    method: 'post',
    data: data,
  })
}
export function flashProductRelationDetail(id: number) {
  return request<CommonResult<FlashProductRelation>>({
    url: '/flashProductRelation/' + id,
    method: 'get',
  })
}
